package com.repair.form;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data
@ApiModel(value = "新增维修材料参数对象")
public class RepairStoreAddForm {
    @ApiModelProperty("材料编码")
    @NotNull(message = "材料编码不能为空")
    @Pattern(regexp = "^[A-Z0-9]+$", message = "材料编码只能包含大写字母和数字")
    @Size(min = 6, max = 12, message = "材料编码长度必须在6到12个字符之间")
    private String materialCode;
    @ApiModelProperty("材料名称")
    @NotNull(message = "材料名称不能为空")
    private String materialName;
    @ApiModelProperty("材料规格")
    @NotNull(message = "材料规格不能为空")
    private String materialStyle;
    @ApiModelProperty("材料数量")
    @NotNull(message = "材料数量不能为空")
    @Min(value = 0, message = "材料数量不能小于0")
    private Integer materialNum;
    @ApiModelProperty("备注")
    private String remarks;
    @ApiModelProperty("材料单位")
    @NotNull(message = "材料单位不能为空")
    private String materialUnit;
}
